﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CoursePack;

namespace WindowsFormsApplication2.Forms
{
    public partial class HomePage : Form
    {
        #region Fields
        private Student m_Student;
        #endregion

        #region Constructor
        public HomePage(Student _Student)
        {
            InitializeComponent();
            this.m_Student = _Student;
        }
        #endregion

        private void HomePage_Load(object sender, EventArgs e)
        {
            //Change title label with the name of the student
            this.lblTitle.Text = "Welcome " + this.m_Student.ToString() + " !";
        }

        private void btnScheduleGenerator_Click(object sender, EventArgs e)
        {
           
                ScheduleViewer attachedForm = new ScheduleViewer(this.m_Student);
                attachedForm.FormBorderStyle = FormBorderStyle.None;
                attachedForm.Dock = DockStyle.Fill;
                attachedForm.ShowInTaskbar = false;
                attachedForm.TopLevel = false;
                this.splitContainer1.Panel2.Controls.Add(attachedForm);
                attachedForm.Show();
            
        }

        private void grNaviguation_Load(object sender, EventArgs e)
        {
            
        }

        private void btnCourseSequence_Click(object sender, EventArgs e)
        {

            this.splitContainer1.Panel2.Controls.Clear();



                MainForm attachedForm = new MainForm();
                attachedForm.FormBorderStyle = FormBorderStyle.None;
                attachedForm.Dock = DockStyle.Fill;
                attachedForm.ShowInTaskbar = false;
                attachedForm.TopLevel = false;
                this.splitContainer1.Panel2.Controls.Add(attachedForm);
                attachedForm.Show();
            
        }

        private void btnStudentRecord_Click(object sender, EventArgs e)
        {

            frmStudentRecord attachedForm = new frmStudentRecord(this.m_Student);
            attachedForm.FormBorderStyle = FormBorderStyle.None;
            attachedForm.Dock = DockStyle.Fill;
            attachedForm.ShowInTaskbar = false;
            attachedForm.TopLevel = false;
            this.splitContainer1.Panel2.Controls.Add(attachedForm);
            attachedForm.Show();
        }

        private void btnAccount_Click(object sender, EventArgs e)
        {
            this.splitContainer1.Panel2.Controls.Clear();

            frmSemesterPicker attachedForm = new frmSemesterPicker(this.m_Student);
            attachedForm.FormBorderStyle = FormBorderStyle.None;
            attachedForm.Dock = DockStyle.Fill;
            attachedForm.ShowInTaskbar = false;
            attachedForm.TopLevel = false;
            this.splitContainer1.Panel2.Controls.Add(attachedForm);
            attachedForm.Show();
        }
    }
}
